import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Nyt7VillageLandRightsVO, Nyt7VillageLandRightsForm, Nyt7VillageLandRightsQuery } from '@/api/Nyt7VillageLandRights/Nyt7VillageLandRights/types';

/**
 * 查询确权数据列表
 * @param query
 * @returns {*}
 */

export const listNyt7VillageLandRights = (query?: Nyt7VillageLandRightsQuery): AxiosPromise<Nyt7VillageLandRightsVO[]> => {
  return request({
    url: '/Nyt7VillageLandRights/Nyt7VillageLandRights/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询确权数据详细
 * @param id
 */
export const getNyt7VillageLandRights = (id: string | number): AxiosPromise<Nyt7VillageLandRightsVO> => {
  return request({
    url: '/Nyt7VillageLandRights/Nyt7VillageLandRights/' + id,
    method: 'get'
  });
};

/**
 * 新增确权数据
 * @param data
 */
export const addNyt7VillageLandRights = (data: Nyt7VillageLandRightsForm) => {
  return request({
    url: '/Nyt7VillageLandRights/Nyt7VillageLandRights',
    method: 'post',
    data: data
  });
};

/**
 * 修改确权数据
 * @param data
 */
export const updateNyt7VillageLandRights = (data: Nyt7VillageLandRightsForm) => {
  return request({
    url: '/Nyt7VillageLandRights/Nyt7VillageLandRights',
    method: 'put',
    data: data
  });
};

/**
 * 删除确权数据
 * @param id
 */
export const delNyt7VillageLandRights = (id: string | number | Array<string | number>) => {
  return request({
    url: '/Nyt7VillageLandRights/Nyt7VillageLandRights/' + id,
    method: 'delete'
  });
};
